<template>
  <div class="screening">
    <div style="flex: 1">
      <div class="title">
        <span>筛选和排序</span>
        <van-icon name="cross" size="4.8vw" class="icon-exit" @click="$router.back()"/>
      </div>
      <van-collapse v-model="activeNames">
        <van-collapse-item title="排序依据" name="1">
          <van-radio-group v-model="checked">
            <div class="collapse">
              <van-radio shape="square" name="1">最佳匹配</van-radio>
            </div>
            <div class="collapse">
              <van-radio shape="square" name="2">新品到货</van-radio>
            </div>
            <div class="collapse">
              <van-radio shape="square" name="3">价格升序排列</van-radio>
            </div>
            <div class="collapse">
              <van-radio shape="square" name="4">价格降序排列</van-radio>
            </div>
          </van-radio-group>
        </van-collapse-item>
        <van-collapse-item title="颜色" name="2">
          <div class="collapse">
            <input type="radio" class="radio" id="id1" name="color">
            <label for="id1" class="radio-box" style="background: #f391a9;">
              <van-icon name="success" size="16px" class="icon"/>
            </label>
            <span class="text">粉色</span>
          </div>
          <div class="collapse">
            <input type="radio" class="radio" id="id2" name="color">
            <label for="id2" class="radio-box" style="background: red;">
              <van-icon name="success" size="16px" class="icon"/>
            </label>
            <span class="text">红色</span>
          </div>
          <div class="collapse">
            <input type="radio" class="radio" id="id3" name="color">
            <label for="id3" class="radio-box" style="background: #7fb80e;">
              <van-icon name="success" size="16px" class="icon"/>
            </label>
            <span class="text">绿色</span>
          </div>
          <div class="collapse">
            <input type="radio" class="radio" id="id4" name="color">
            <label for="id4" class="radio-box" style="background: #00a0ff;">
              <van-icon name="success" size="16px" class="icon"/>
            </label>
            <span class="text">蓝色</span>
          </div>
        </van-collapse-item>
        <van-collapse-item title="尺寸" name="3">
          <van-radio-group v-model="checked1">
            <div class="collapse">
              <van-radio shape="square" name="1">S</van-radio>
            </div>
            <div class="collapse">
              <van-radio shape="square" name="2">M</van-radio>
            </div>
            <div class="collapse">
              <van-radio shape="square" name="3">L</van-radio>
            </div>
            <div class="collapse">
              <van-radio shape="square" name="4">XL</van-radio>
            </div>
          </van-radio-group>
        </van-collapse-item>
      </van-collapse>
    </div>
    <div class="bottom">
      <p class="btn">应用筛选</p>
      <p class="btn">删除</p>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      activeNames: [],
      checked: null,
      checked1: null
    }
  }
}
</script>

<style lang="scss" scoped>
.screening {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #fff;
  position: relative;
  overflow: hidden;
  .title {
    line-height: 50px;
    text-align: center;
    span {
      font-size: 18px;
      font-weight: 500;
    }
    .icon-exit {
      position: absolute;
      right: 10px;
      top: 17px;
    }
  }
  .collapse {
    display: flex;
    height: 30px;
    align-items: center;
    padding-left: 20px;
    .radio {
      display: none;
    }
    .radio-box {
      width: 18px;
      height: 18px;
      border: 1px solid #ccc;
      .icon {
        margin: 1px 0 0 1px;
        color: transparent;
      }
    }
    .radio:checked + .radio-box {
      .icon {
        color: #fff;
      }
    }
    .text {
      text-indent: 10px;
      color: #323333;
    }
  }
  .bottom {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    .btn {
      width: 40vw;
      line-height: 40px;
      text-align: center;
      &:nth-child(1) {
        background: #000;
        color: #fff;
      }
      &:nth-child(2) {
        border: 1px solid #000;
        color: #000;
        box-sizing: border-box;
      }
    }
  }
  /deep/.van-cell__right-icon {
    color: #000;
  }
  /deep/.van-cell__title {
    font-size: 16px;
  }
}
</style>